/*
 * @Author: 六弦(melodyWxy)
 * @Date: 2022-03-01 14:33:35
 * @LastEditors: 六弦(melodyWxy)
 * @LastEditTime: 2022-03-01 14:55:33
 * @FilePath: /menorepo-demo/Users/wxy/codeWorks/up/d_form/antd-demo-ts/src/pages/AddForm/Step0/index.tsx
 * @Description: update here
 */

import { FC } from 'react';
import XForm from "../../../components/XForm"
import { FormSets, FormItemSets, ChildTypeSets } from './../../../components/XForm/type';

import type { Step0Props } from './../type';
 
const Step0: FC<Step0Props> = ({ stepNext })=> {
    return (
        <div>
            <XForm  schema={{
                type: FormSets.Form,
                props: {},
                onFinish: (value)=>{stepNext(value)},
                btns: [{
                    submit: true,
                    text: '下一步'
                }],
                children: [{
                    type: FormItemSets.Item,
                    props: {
                        label: '表单标题'
                    },
                    name: 'title',
                    child: {
                        type: ChildTypeSets.Input,
                    }
                },{
                    type: FormItemSets.Item,
                    props: {
                        label: '表单类型'
                    },
                    name: 'type',
                    child: {
                        type: ChildTypeSets.Select,
                        props: {
                            options: Object.keys(FormSets).map(item=> ({
                                label: item,
                                value: item
                            }))
                        }
                    }
                }]
            }}/>
        </div>
    )
}


export default Step0